<cfcomponent extends="assets.calgrants.com.Base">

	<cfscript>
        import assets.calgrants.com.service.StudentFacebookService;
		this.service = new StudentFacebookService();
	</cfscript>

	<cffunction name="get" output="false" access="remote" returntype="assets.calgrants.com.bo.StudentFacebook">
		<cfreturn this.service.get(argumentCollection = arguments) />
	</cffunction>
	
	<cffunction name="query" output="false" access="public" returntype="query">
		<cfreturn this.service.read(argumentCollection = arguments) />
	</cffunction>
	
	<cffunction name="save" output="false" access="public" returntype="any">
        <cfscript>
			var studentFacebook = "";
			var studentFacebook_ = this.service.get(Student_Facebook_ID = arguments.Student_Facebook_ID);
			if (IsInstanceOf(arguments[1], "assets.calgrants.com.bo.StudentFacebook")) {
				studentFacebook = arguments[1];
			} else {
				var args = {};
				StructAppend(args, arguments);
				args.obj = Duplicate(studentFacebook_);
				studentFacebook = this.service.load(argumentCollection = v);
			}
		    var validator = getValidator();
		    var validationResults = validator.validate(studentFacebook);
		    if (validationResults.getIsSuccess()) {
                studentFacebook.setStudent_Facebook_ID(this.service.save(studentFacebook));
                return studentFacebook;
            } else {
                return validationResults.getFailures();
            }
        </cfscript>
	</cffunction>
	
	<cffunction name="delete" output="false" access="public" returntype="boolean">
		<cfreturn this.service.destroy(argumentCollection = arguments) />
	</cffunction>
	
</cfcomponent>